import { lazy } from "react";
import { Navigate } from 'react-router-dom'
import { createBrowserRouter } from "react-router-dom";
const App=lazy(()=>import('../App'))
const Detail=lazy(()=>import('../peomise/Detail'))
const Home=lazy(()=>import('../peomise/Home'))
const Login=lazy(()=>import('../peomise/Login'))
const My=lazy(()=>import('../peomise/My'))
const MyLayout = lazy(() => import('../peomise/MyLayout'))

type homelistRouter = {
    path: string;
    element: JSX.Element;
    children?: homelistRouter;
    icon?: any;
    label: string;
}[]

export const tabbars:homelistRouter = [
    {
        path: '/detail',
        element: <Detail />,
        // icon:,
        label:'详情'
    },
    {
        path: '/home',
        element: <Home />,
        // icon:,
        label:'首页'
    },
]

 const routes:homelistRouter = [
    {
        path: '/',
        element: <App />,
         children: tabbars,
        label:''
    },
    {
        path: '/login',
        element: <Login />,
        // icon:,
        label:''
    },
]

const router=createBrowserRouter(routes)
export default router

